﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using client35.Properties;

namespace client35 {
	public partial class ip_select_frm : Form {
		public ip_select_frm() {
			InitializeComponent();
			this.label1.Text = "检测到系统有多个ip地址，请选择您需使用的地址";
			var ip_list = Dns.GetHostEntry(Dns.GetHostName()).AddressList.ToList();
			this.listBox1.DataSource = ip_list;
		}

		private void button1_Click(object sender, EventArgs e) {
			var current_ip = listBox1.SelectedItem.ToString();
			Settings.Default.current_ip = current_ip;
			Settings.Default.Save();
			this.DialogResult = DialogResult.OK;
			this.Close();
		}
	}
}
